package com.dao.impl;

import com.dao.AccountDao;
import com.neu.dao.BaseDao;

import java.util.List;
import java.util.Map;

public class AccountDaoImpl extends BaseDao implements AccountDao {

    @Override
    public List<Map<String, Object>> findAll(String id) {
        List<Map<String,Object>> list = null;
        String sql ="SELECT ac_out,ac_in,ac_info,ac_date\n" +
                "FROM ac_account\n" +
                "WHERE ac_user_id = ?";
        list = super.executeQuery(sql,id);
        System.out.println(list);
        return list;
    }

    @Override
    public int ainsert(String ain, String aout, String ainfo, String aid, String adate) {
        int row = 0;
        String sql="INSERT INTO ac_account(ac_in,ac_out,ac_info,ac_user_id,ac_date)\n" +
                "VALUES(?,?,?,?,?)";
        row = super.executeUpdate(sql,ain,aout,ainfo,aid,adate);
        return row;
    }
}
